<%-- 
    Document   : addshowtime
    Created on : May 5, 2011, 12:53:11 AM
    Author     : Kevin
--%>

<%@page import="java.util.Iterator"%>
<%@page contentType="text/html" import="java.util.Set" import="com.movie.*" pageEncoding="UTF-8"%>
<%@include file="headero.html"%>
<!DOCTYPE html>
<html>
    
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>


        <form method='POST' name='showtime' action='dispatcher?operation=addshowtime' onSubmit='return valFormShowTime()'>
            <center><table width='700px' border='0'>

                    <tr>
                        <td>
                            Cinema
                        </td>
                        <td>
                            Room
                        </td>
                        <td>
                            Time
                        </td>
                    </tr>

                    <%
                        Set cinemaSet = (Set) request.getAttribute("cinemaset");
                        Iterator it = cinemaSet.iterator();
                        while (it.hasNext()) {
                            ;
                            Cinema cinema = (Cinema) it.next();

                            out.println("<tr>");
                            out.println("<td>");
                            out.println("<INPUT type='radio' name='idcinema' value='" + Integer.toString(cinema.getIdcinema()) + "'>" + cinema.getLocation());
                            out.println("</td>");
                            out.println("<td>");

                            out.println("<select name='room"+Integer.toString(cinema.getIdcinema())+"'>");
                            Set roomSet = cinema.getRooms();
                            Iterator it1 = roomSet.iterator();
                            int countr = 0;
                            while (it1.hasNext()) {
                                Room room = (Room) it1.next();
                                countr++;
                                out.println("<option value='" + room.getIdroom() + "'>Room " + Integer.toString(countr) + "</option>");
                            }
                            out.print(" </select>");
                            out.println("</td>");
                            out.println("<td>");
                            out.println("<select name='time"+Integer.toString(cinema.getIdcinema())+"'>");
                            out.println("<option value='11:00:00'>11:00:00</option>");
                            out.println("<option value='13:00:00'>13:00:00</option>");
                            out.println("<option value='15:00:00'>15:00:00</option>");
                            out.println("<option value='17:00:00'>17:00:00</option>");
                            out.println("<option value='19:00:00'>19:00:00</option>");
                            out.print(" </select>");
                            //out.println("<input type='hidden' name='numseatavailable" + show.getIdshow() + "' value='" + Integer.toString(DaoShow.SeatsAvailable(show, comb)) + "'size='15' />" + Integer.toString(DaoShow.SeatsAvailable(show, comb)));
                            out.println("</td>");
                            out.println("</tr>");
                            //out.println("<input type='hidden' name='datebook" + show.getIdshow() + "' value='" + comb.getTime() + "'size='15' />");
                        }
                    %>

                </table></center>
            <p>&nbsp;</p>
            <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <input type='submit' value='Add' class='button'/></p>
        </form>


        %>



    </body>
</html>
<%@include file="footer.html"%>